<%--
  Created by IntelliJ IDEA.
  User: 陈俊雄
  Date: 2018/5/24
  Time: 10:10
--%>
<%@ page contentType="text/html;charset=UTF-8" %>
<!-- Main view -->
<div class="animated fadeInRight">
    <div class="wrapper wrapper-content ng-scope" ng-controller="merchantWebSiteCtrl">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>{{ 'MERCHANT_WEB_SITE' | translate }}</h5>
                    </div>
                    <div class="ibox-content sk-loading">
                        <div class="sk-spinner sk-spinner-wave">
                            <div class="sk-rect1"></div>
                            <div class="sk-rect2"></div>
                            <div class="sk-rect3"></div>
                            <div class="sk-rect4"></div>
                            <div class="sk-rect5"></div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 col-md-6 col-lg-1-5">
                                <div class="form-group form-group-sm">
                                    <div class="input-group">
                                        <span class="input-group-addon">商户号：</span>
                                        <select class="form-control b-r-sm" ng-model="searchInfo.merId"
                                                ng-options="x.id as x.id + '(' + x.name + ')' for x in merchantInfo">
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6 col-md-6 col-lg-1-5">
                                <div class="form-group form-group-sm">
                                    <div class="input-group">
                                        <span class="input-group-addon">域名：</span>
                                        <select class="form-control b-r-sm" ng-model="searchInfo.id"
                                                ng-options="x.id as x.siteUrl for x in siteUrls">
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6 col-md-6 col-lg-1-5">
                                <div class="form-group form-group-sm">
                                    <div class="input-group">
                                        <span class="input-group-addon">行业类型：</span>
                                        <select class="form-control b-r-sm" ng-model="searchInfo.industryId"
                                                ng-options="x.firstValue as x.name for x in industryType">
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6 col-md-6 col-lg-1-5">
                                <div class="form-group form-group-sm">
                                    <div class="input-group">
                                        <span class="input-group-addon">产品类型：</span>
                                        <select class="form-control b-r-sm" ng-model="searchInfo.productTypeId"
                                                ng-options="x.productTypeId as x.productTypeName for x in merchantWebsiteProType">
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="col-sm-6 col-md-6 col-lg-1-5">
                                <div class="form-group form-group-sm">
                                    <div class="input-group">
                                        <span class="input-group-addon">状态：</span>
                                        <select class="form-control b-r-sm" ng-model="searchInfo.status"
                                                ng-options="x.firstValue as x.name for x in webSiteStatus">
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-6 col-md-6 col-lg-3 col-lg-offset-3">
                                <button class="btn btn-sm btn-w-m btn-primary pull-right" ng-click="search(searchInfo)">
                                    查询
                                </button>
                            </div>
                            <div class="col-sm-6 col-md-6 col-lg-3">
                                <button class="btn btn-sm btn-w-m btn-info" ng-click="reset()">
                                    重置
                                </button>
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <button class="btn btn-sm btn-primary" ng-click="showModal(0)">新增</button>
                        <div class="table-responsive">
                            <table ng-table="webSiteTable"
                                   class="table table-condensed table-striped table-hover table-bordered">
                                <tr ng-repeat="row in $data">
                                    <td class="text-center p-6" style="width: 35px">
                                        <input type="checkbox" ng-model="selected[row.id]">
                                    </td>
                                    <td class="text-center" data-title="'商户号'">
                                        {{row.merId | getMerIdAndName : merchantInfo}}
                                    </td>
                                    <td class="text-center" data-title="'域名'">
                                        {{row.siteUrl}}
                                    </td>
                                    <td class="text-center" data-title="'行业类型'">
                                        {{row.industryId | getValueByList : industryType : 'firstValue' : 'name'}}
                                    </td>
                                    <td class="text-center" data-title="'产品类型'">
                                        {{row.productTypeId | getValueByList : merchantWebsiteProType : 'id' :
                                        'productTypeName'}}
                                    </td>
                                    <td class="text-center" data-title="'结算周期'">
                                        {{row.settleCycle}}
                                    </td>
                                    <td class="text-center" data-title="'结算日'">
                                        {{row.settleDay}}
                                    </td>
                                    <td class="text-center" data-title="'创建人'">
                                        {{row.creator}}
                                    </td>
                                    <td class="text-center" data-title="'创建时间'">
                                        {{row.createTime | date : 'yyyy/MM/dd'}}
                                    </td>
                                    <td class="text-center" data-title="'操作人'">
                                        {{row.modifier}}
                                    </td>
                                    <td class="text-center" data-title="'操作时间'">
                                        {{row.modifyTime | date : 'yyyy/MM/dd'}}
                                    </td>
                                    <td class="text-center" data-title="'状态'">
                                        {{row.status | getValueByList : webSiteStatus : 'firstValue' : 'name'}}
                                    </td>
                                    <td class="text-center" style="width: 163px" data-title="'操作'">
                                        <div style="min-width: 148px">
                                            <button class="btn btn-xs btn-success no-margins" ng-click="edit(1, row)">
                                                域名
                                            </button>
                                            <button class="btn btn-xs btn-info" style="margin: 0 0 0 10px"
                                                    ng-click="goMerchantWebSiteRate(row)">
                                                扣率
                                            </button>
                                            <constant-status-btn style="margin: 0 0 0 10px" row="{{row}}"
                                                                 status-constant="{{webSiteStatus}}"
                                                                 status-change="statusChange($event, row)"></constant-status-btn>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <button class="btn btn-sm btn-primary pull-left" ng-click="del()" ng-disabled="delDisabled()">
                            删除
                        </button>
                        <my-pagination table-param="webSiteTable"></my-pagination>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>